package cn.com.xf.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import cn.com.xf.dao.TbAppAuditingAreasDAO;
import cn.com.xf.dao.support.XFSqlMapClientDaoSupport;
import cn.com.xf.domain.TbAppAreas;
import cn.com.xf.domain.TbAppAuditingAreas;
@Repository
public class TbAppAuditingAreasDAOImpl extends XFSqlMapClientDaoSupport implements TbAppAuditingAreasDAO {
	@Override
	public void insert(TbAppAuditingAreas appArea) {
		getSqlMapClientTemplate().insert("TB_APP_AUDITING_AREAS.insert", appArea);
		
	}

	@Override
	public TbAppAuditingAreas selectByAreaid(String areaid) {
		// TODO Auto-generated method stub
		return (TbAppAuditingAreas) getSqlMapClientTemplate().queryForObject("TB_APP_AUDITING_AREAS.selectByAreaid",areaid);
	}

	@Override
	public List<TbAppAuditingAreas> selectAuditingArea(int begin, int pageSize, String orderByField, String orderByMode,
			String siteid, String areaname) {
		Map<String,Object> map = new HashMap<String, Object>();
		int end = begin + pageSize;
		begin = begin + 1;
		map.put("begin", begin);
		map.put("end", end);
		map.put("orderByField", orderByField);
		map.put("orderByMode", orderByMode);
		map.put("siteid", siteid);
		map.put("areaname", areaname);
		
		List<TbAppAuditingAreas> list = getSqlMapClientTemplate().queryForList("TB_APP_AUDITING_AREAS.selectAuditingArea",map);
		return list;
	}

	@Override
	public int selectAuditingAreaCount(String siteid, String areaname) {
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("siteid", siteid);
		map.put("areaname", areaname);
		return (Integer)getSqlMapClientTemplate().queryForObject("TB_APP_AUDITING_AREAS.selectAuditingAreaCount",map);
	}
	@Override
	public int delAuditingByAreaid(String areaid) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().update("TB_APP_AUDITING_AREAS.delAuditingByAreaid", areaid);
	}

	@Override
	public int checkedMapByAreaid(String areaid) {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public int checkByAreaid_1(String areaid) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().update("TB_APP_AUDITING_AREAS.checkByAreaid_1", areaid);
	}
	@Override
	public int updateAuditing(TbAppAuditingAreas appArea) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().update("TB_APP_AUDITING_AREAS.updateAuditing", appArea);
	}
	@Override
	public int updateCheckDate(TbAppAuditingAreas appArea) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().update("TB_APP_AUDITING_AREAS.updateCheckDate", appArea);
	}

	@Override
	public int checkByAreaid_0(String areaid) {
		// TODO Auto-generated method stub
		return getSqlMapClientTemplate().update("TB_APP_AUDITING_AREAS.checkByAreaid_0", areaid);
	}

}
